from error import *
class Location:
    def __init__(self,id):
        """"constructor"""
        self.id = id
        self.name = ""
        self.shares = {}
        self.automount = True
        self.param_location = {"ipl":[],"ipd":[],"dns":[]} #ipl:IP Local, ipd IP Distante, dns = Nom de domain

#Private        
    def __check_param_exist(self,type,value):
        if value == "" or value in self.param_location[type]:
                return True
        return False

#Public
    def add_param(self,type,param):
        if not self.__check_param_exist(type,param):
            self.param_location[type].append(param)
            return True
        else:
            debug("Already exist or empty")
            return False
        
    def to_string(self):
        print "location (" + self.id + ") : " + self.name